package com.yans
{
	import com.yans.interfaces.ICacheManager;
	import com.yans.interfaces.IFileManager;
	import com.yans.interfaces.IImageApi;
	import com.yans.interfaces.IKeyboardApi;
	import com.yans.interfaces.ILoaderManager;
	import com.yans.interfaces.ILogManager;
	import com.yans.interfaces.IMouseManager;
	import com.yans.interfaces.IRegexMatcher;
	import com.yans.interfaces.ISQLLiteManager;
	import com.yans.interfaces.IRiverManager;
	import com.yans.interfaces.ITimeManager;
	import com.yans.managers.CacheManager;
	import com.yans.managers.ImageApi;
	import com.yans.managers.KeyboardManager;
	import com.yans.managers.LoaderManager;
	import com.yans.managers.LogManager;
	import com.yans.managers.MouseManager;
	import com.yans.managers.RegexMatcher;
	import com.yans.managers.RiverManager;
	import com.yans.managers.TimeManager;
	 
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.IEventDispatcher;
	
	public class GlobalAPICore 
	{
		/**
		 *	河流
		 */		
		public static var river:IRiverManager;
		/**
		 *	文件管理者 
		 */		
		public static var fileManager:IFileManager;
		/**
		 *	鼠标管理器 
		 */		
		public static var mouseManager:IMouseManager;
		/**
		 *	时间管理器 
		 */		
		public static var timeManager:ITimeManager;
		/**
		 *	缓存管理器 
		 */		
		public static var cacheManager:ICacheManager;
		/**
		 *	数据管理器 
		 */		
		public static var sqlManager:ISQLLiteManager;
		/**
		 * 	日志管理器
		 */
		public static var logManager:ILogManager;
		
		/**
		 *	加载管理器 
		 */		
		public static var loaderManager:ILoaderManager;
		
		/**
		 *	键盘管理器 
		 */		
		public static var keyboardManager:IKeyboardApi;
		
		/**
		 *	图片处理器 
		 */		
		public static var imageManager:IImageApi;
		
		/**
		 *	正则匹配器 
		 */		
		public static var regexMatcher:IRegexMatcher;
		 
		public function GlobalAPICore() {
		} 
		
		public static function setup(listener:Stage):void {
			if(!river) river = new RiverManager(listener) as IRiverManager; 
			
			if(!mouseManager) mouseManager = new MouseManager(listener) as IMouseManager;
		
			if(!timeManager) timeManager = new TimeManager() as ITimeManager;
			
			if(!cacheManager) cacheManager = new CacheManager as ICacheManager; 
			
			if(!logManager) logManager = new LogManager as ILogManager;
			
			if(!loaderManager) loaderManager = new LoaderManager as ILoaderManager;
			
			if(!keyboardManager) keyboardManager = new KeyboardManager(listener) as IKeyboardApi;
			
			if(!regexMatcher) regexMatcher = new RegexMatcher as IRegexMatcher;
			
			if(!imageManager) imageManager = new ImageApi as IImageApi;
		}
		
		
	}
}